﻿using System;
using System.Runtime.Serialization;

namespace NMemcached.Client
{
    /// <summary>
    /// The exception that is thrown when a Memcached server returns an error
    /// </summary>
    [Serializable]
    public class MemcachedException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the MemcachedException class
        /// </summary>
        /// <param name="message">The error message returned from the server.</param>
        public MemcachedException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the MemcachedException class
        /// </summary>
        /// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown</param>
        /// <param name="context">The StreamingContext that contains contextual information about the source or destination</param>
        protected MemcachedException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}
